'   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '           N a m e :   W X M _ T e a c h 1 _ 0 1 . t x t                                           D a t e :   1 1   O c t o b e r   2 0 1 9 
 
 '         A u t o r :   L e o n a r d o   D E   P A L O   P h . D . 
 
 '         S c o p e :   G e n e r a t i n g   a   t e s t   r o b o t   f o r   t e a c h i n g . 
 
 '   H a r d w a r e :   U s i n g   t h e   o l d   c a r t e s i a n   s y s t e m , v i d e o   a n d   a u d i o . 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 
 
 L o a d   D o o r B e l l . w a v 
 
 S p e e d   9 
 
 B u t t o n   1   T e x t   " H O M E   A l l " 
 
 
 
 B u t t o n   7   T e x t   " S T A R T   T E S T " 
 
 
 
 L o a d   T h e r e m i n o _ H A L \ T h e r e m i n o _ H A L . e x e 
 
 L o a d   T h e r e m i n o _ H A L \ T h e r e m i n o _ S l o t V i e w e r . e x e 
 
 ' L o a d   T h e r e m i n o _ H A L \ T h e r e m i n o _ M e d i a P l a y e r . e x e 
 
 ' L o a d   T h e r e m i n o _ H A L \ T h e r e m i n o _ T e r m i n a l . e x e 
 
 ' L o a d   T h e r e m i n o _ H A L \ T h e r e m i n o _ S l o t s T o S p e e c h . e x e 
 
 ' L o a d   T h e r e m i n o _ H A L \ \ T h e r e m i n o _ M i c r o V i d e o _ V 1 . 4 _ C A M \ T h e r e m i n o _ M i c r o V i d e o \ T h e r e m i n o _ M i c r o V i d e o . e x e 
 
 L o a d   T h e r e m i n o _ H A L \ T h e r e m i n o _ M i c r o V i d e o . e x e 
 
 L o a d   T h e r e m i n o _ H A L \ T h e r e m i n o _ S i g n a l S c o p e . e x e 
 
 
 
 V a r i a b l e   N u m e r i c   D i g i t T i m e 
 
 V a r i a b l e   N u m e r i c   N u m T e s t 
 
 V a r i a b l e   N u m e r i c   N u m C y c l e s 
 
 V a r i a b l e   N u m e r i c   C u r r e n t 
 
 V a r i a b l e   N u m e r i c   E r r o r N u m b e r 
 
 V a r i a b l e   N u m e r i c   E r r o r P e r c e n t a g e 
 
 
 
 V a r i a b l e   N u m e r i c   C o o r d _ Z 
 
 V a r i a b l e   N u m e r i c   C o o r d _ A 
 
 V a r i a b l e   N u m e r i c   C o o r d _ X P 
 
 V a r i a b l e   N u m e r i c   C o o r d _ X R 
 
 
 
 V a r i a b l e   N u m e r i c   S l o t M o t o r 
 
 V a r i a b l e   N u m e r i c   S l o t S e n s o r 
 
 V a r i a b l e   N u m e r i c   S p e e d S e a r c h 
 
 V a r i a b l e   N u m e r i c   S p e e d R e t u r n 
 
 V a r i a b l e   N u m e r i c   D e c l a r e d Z e r o 
 
 V a r i a b l e   N u m e r i c   I n i t i a l P o s i t i o n 
 
 
 
 V a r i a b l e   S t r i n g   I n f o 
 
 V a r i a b l e   S t r i n g   R e s u l t 
 
 
 
 D i g i t T i m e   =   1 . 5 
 
 C o o r d _ X P   =   1 9 3 
 
 C o o r d _ X R   =   1 7 5 
 
 
 
 K e y   R i g h t 	 	 G o s u b   M o v e R i g h t M 0 
 
 K e y   L e f t   	 	 G o s u b   M o v e L e f t M 0 
 
 K e y   U p   	 	 	 G o s u b   M o v e R i g h t M 1 
 
 K e y   D o w n   	 	 G o s u b   M o v e L e f t M 1 
 
 K e y   P a g e u p 	 	 G o s u b   M o v e U p M 2 
 
 K e y   P a g e d o w n 	 G o s u b   M o v e D o w n M 2 
 
 K e y   S 	 	 	 G o s u b   " S T A R T   T E S T " 
 
 
 
 G o s u b   R E D 
 
 S l o t ( 3 0 )   =   0 	 	 '   L A S E R   O F F 
 
 G o s u b   " S t o p R e c o r d " 
 
 S t o p 
 
 
 
 '   = = = = = = = = = = = = = = =     P   I   N         T   E   S   T     = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   " S T A R T   T E S T " 
 
 	 s 2   =   " T e s t _ L o c k _ V i d e o . t x t " 
 
 	 S 9   =   " -   D A T E   -   "   +   "   -   T I M E   -   "   +   "   C Y C L E   "   +   "   R E S U L T   "   +   "          N U M .   "   +   "     R A T E   I N   % " 
 
 	 S a v e   S t r i n g T o F i l e   s 9   s 2 
 
 	 S a v e   S t r i n g T o F i l e   " -  =  -  =  -  =  -   S T A R T   -  =  -  =  -  =  -  "   s 2 
 
 	 ' N u m T e s t   =   I n p u t   " T e l l   m e   h o w   m a n y   c y c l e : " 
 
 	 N u m T e s t   =   2 0 0 0 0 
 
 	 N u m C y c l e s   =   0 
 
 	 L a b e l   L o o p T e s t 
 
 	 	 N u m C y c l e s   =   N u m C y c l e s   +   1 
 
 	 	 I f   N u m C y c l e s   >   N u m T e s t 
 
 	 	 	 G o s u b   W H I 
 
 	 	 	 R e t u r n 
 
 	 	 E n d I f 
 
 	 	 G o s u b   " H O M E   A l l " 
 
 	 	 G o s u b   " R a i s e   H a n d l e r " 
 
 	 	 G o s u b   " S t a r t R e c o r d " 
 
 	 	 G o s u b   " B u t t o n   O N " 
 
 	 	 G o s u b   " B u t t o n   P A D L O C K " 
 
 	 	 G o s u b   " B u t t o n   1 " 
 
 	 	 G o s u b   " B u t t o n   2 " 
 
 	 	 G o s u b   " B u t t o n   3 " 
 
 	 	 G o s u b   " B u t t o n   4 " 
 
 	 	 G o s u b   " B u t t o n   5 " 
 
 	 	 G o s u b   " B u t t o n   6 " 
 
 	 	 G o s u b   " B u t t o n   E N T E R " 
 
 	 	 W a i t   S e c o n d s   1 
 
 	 	 G o s u b   " L o w e r   H a n d l e r " 
 
 	 	 G o s u b   " C h e c k   L a t c h " 
 
 	 	 G o s u b   " S t o p R e c o r d " 
 
 	 	 G o s u b   " H O U S E " 
 
 	 G o t o   L o o p T e s t 
 
 R e t u r n 
 
 
 
 L a b e l   " B u t t o n   O N " 
 
 	 C o o r d _ Z   =       1 8 
 
 	 C o o r d _ A   =     1 2 3 
 
 	 G o s u b   " E X E C " 
 
 R e t u r n 
 
 
 
 L a b e l   " B u t t o n   P A D L O C K " 
 
 	 C o o r d _ Z   =       3 8 
 
 	 C o o r d _ A   =       9 8 
 
 	 G o s u b   " E X E C " 
 
 R e t u r n 
 
 
 
 L a b e l   " B u t t o n   1 " 
 
 	 C o o r d _ Z   =       6 7 
 
 	 C o o r d _ A   =       9 3 
 
 	 G o s u b   " E X E C " 
 
 R e t u r n 
 
 
 
 L a b e l   " B u t t o n   2 " 
 
 	 C o o r d _ Z   =       6 7 
 
 	 C o o r d _ A   =     1 0 8 
 
 	 G o s u b   " E X E C " 
 
 R e t u r n 
 
 
 
 L a b e l   " B u t t o n   3 " 
 
 	 C o o r d _ Z   =       6 7 
 
 	 C o o r d _ A   =     1 2 2 
 
 	 G o s u b   " E X E C " 
 
 R e t u r n 
 
 
 
 L a b e l   " B u t t o n   4 " 
 
 	 C o o r d _ Z   =       5 7 
 
 	 C o o r d _ A   =       9 3 
 
 	 G o s u b   " E X E C " 
 
 R e t u r n 
 
 
 
 L a b e l   " B u t t o n   5 " 
 
 	 C o o r d _ Z   =       5 7 
 
 	 C o o r d _ A   =     1 0 8 
 
 	 G o s u b   " E X E C " 
 
 R e t u r n 
 
 
 
 L a b e l   " B u t t o n   6 " 
 
 	 C o o r d _ Z   =       5 7 
 
 	 C o o r d _ A   =     1 2 2 
 
 	 G o s u b   " E X E C " 
 
 R e t u r n 
 
 
 
 L a b e l   " B u t t o n   7 " 
 
 	 C o o r d _ Z   =       4 7 
 
 	 C o o r d _ A   =       9 3 
 
 	 G o s u b   " E X E C " 
 
 R e t u r n 
 
 
 
 L a b e l   " B u t t o n   8 " 
 
 	 C o o r d _ Z   =       4 7 
 
 	 C o o r d _ A   =     1 0 8 
 
 	 G o s u b   " E X E C " 
 
 R e t u r n 
 
 
 
 L a b e l   " B u t t o n   9 " 
 
 	 C o o r d _ Z   =       4 7 
 
 	 C o o r d _ A   =     1 2 2 
 
 	 G o s u b   " E X E C " 
 
 R e t u r n 
 
 
 
 L a b e l   " B u t t o n   0 " 
 
 	 C o o r d _ Z   =       3 7 
 
 	 C o o r d _ A   =     1 0 8 
 
 	 G o s u b   " E X E C " 
 
 R e t u r n 
 
 
 
 L a b e l   " B u t t o n   E N T E R " 
 
 	 C o o r d _ Z   =       3 8 
 
 	 C o o r d _ A   =     1 2 2 
 
 	 G o s u b   " E X E C " 
 
 R e t u r n 
 
 
 
 L a b e l   " E X E C " 
 
 	 S l o t ( 5 )     =   C o o r d _ Z 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t ( 2 5 )   =   C o o r d _ A 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t ( 1 )     =   C o o r d _ X P 
 
 	 W a i t   S e c o n d s   D i g i t T i m e 
 
 	 S l o t ( 1 )     =   C o o r d _ X R 
 
 R e t u r n 
 
 
 
 L a b e l   " C h e c k   L a t c h " 
 
 	 S l o t ( 3 0 )   =   1 0 0 0 	 	 	 	 ' L A S E R   O N 
 
 	 W a i t   S e c o n d s   0 . 5 
 
 	 I f   S l o t ( 3 2 )   < 5 0 0 
 
 	 	 R e s u l t   =   " * * * * * * * * * * * * * *   L A S E R   D I S A L L I G N E D   * * * * * * * * * * * * * * * " 
 
 	 	 s 1   =   s 1   +   "   "   +   F o r m a t ( N u m C y c l e s ,   " 0 0 0 " )   +   "   "   +   R e s u l t 
 
 	 	 S a v e   S t r i n g T o F i l e   s 1   s 2 
 
 	 	 P r i n t   s 1 
 
 	 E n d I f 
 
 	 S l o t   ( 1 )   =   5   	 	 	 	 '   m o v e   X   t o   o p t i m i z e   t i m i n g 
 
 	 S l o t ( 2 5 )   =       5 4         	 	   	 '   m o v e   A   t o   c h e c k   i f   l a t c h   i s   o u t 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 W a i t   S e c o n d s   0 . 5 
 
 	 I f   S l o t ( 3 2 )   >   5 0 0 	 	 	 '   L A S E R   s e n s o r 
 
 	 	 G o s u b   " P A S S "   	 	 	 '   l a t c h   i n s i d e 
 
 	 E l s e 
 
 	 	 G o s u b   " F A I L " 
 
 	 E n d I f 
 
 	 S l o t ( 3 0 )   =   0 	 	 	 	 '   L A S E R   O F F 
 
 R e t u r n 
 
 
 
 L a b e l   " P A S S " 
 
 	 G o s u b   G R E 
 
 	 R e s u l t   =   "   - P A S S -   " 
 
 	 G o s u b   " U P D A T E _ F I L E " 
 
 R e t u r n 
 
 
 
 L a b e l   " F A I L " 
 
 	 G o s u b   R E D 
 
 	 G o s u b   " S a v e R e c o r d " 
 
 	 L o a d   D o o r B e l l . w a v 
 
 	 E r r o r N u m b e r   =   E r r o r N u m b e r   +   1 
 
 	 E r r o r P e r c e n t a g e   =   ( 1 0 0   *   E r r o r N u m b e r )   /   N u m C y c l e s 
 
 	 R e s u l t   =   "   - F A I L -   "   +   " N u m   E r r : "   +   F o r m a t ( E r r o r N u m b e r ,   " 0 0 0 " )   +   "      % = "   +   F o r m a t ( E r r o r P e r c e n t a g e ,   " 0 0 . 0 0 " ) 
 
 	 G o s u b   " U P D A T E _ F I L E " 
 
 R e t u r n 
 
 
 
 L a b e l   " U P D A T E _ F I L E " 
 
 	 s 1   =   " " 
 
 	 s 1   =   N o w 
 
 	 s 1   =   s 1   +   "   "   +   F o r m a t ( N u m C y c l e s ,   " 0 0 0 " )   +   "   "   +   R e s u l t 
 
 	 P r i n t   s 1 
 
 	 S a v e   S t r i n g T o F i l e   s 1   s 2 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = =   V   I   D   E   O   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   " S t a r t R e c o r d " 
 
 	 S l o t ( 4 9 )   =   1 0 0 0 	 	 	 ' 	 S t a r t   r e c o r d i n g 
 
 R e t u r n 
 
 
 
 L a b e l   " S t o p R e c o r d " 
 
 	 S l o t ( 4 9 )   =   0 
 
 R e t u r n 
 
 
 
 L a b e l   " S a v e R e c o r d " 
 
 	 S l o t ( 5 0 )   =   1 0 0 0 	 	 	 '   s a v e   t o   f i l e 
 
 	 W a i t   S e c o n d s   0 . 1 
 
 	 S l o t ( 5 0 )   =         0 
 
 	 S l o t ( 4 9 )   =         0 	 	 	 '   S t o p   r e c o r d i n g   a n d   s a v e   t o   f i l e 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = =   H A N D L E R   M A N A G E M E N T   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   " R a i s e   H a n d l e r " 
 
 	 G o s u b   G R E 
 
 	 S l o t ( 2 5 )   =   1 8 0           	 ' A   g o   t o   r a i s i n g   a r e a 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t ( 5 )     =     1 5 	   	 ' Z   p e p a r e   f o r   r a i s i n g   a r e a 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t ( 1 )     =   1 8 8           	 ' X   g o   t o   r a i s i n g   a r e a 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t ( 5 )     =   1 0 0 	       	 ' Z   r a i s e   t h e   h a n d l e 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 W a i t   S e c o n d s   0 . 5 
 
 	 S l o t ( 5 )     =     1 8 	       	 ' Z   L o w e r   t h e   h a n d l e 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t ( 1 )     =   1 7 5           	 ' X   g o t o   s a f e   a r e a 
 
 R e t u r n 
 
 
 
 L a b e l   " L o w e r   H a n d l e r " 
 
 	 S l o t ( 5 )     =     8 0 	   	 ' Z   p e p a r e   f o r   a c t i o n s   a r e a 
 
 	 S l o t ( 1 )     =   1 8 8           	 ' X   g o   t o   l o w e r   a r e a 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t ( 2 5 )   =   1 8 0           	 ' A   g o   t o   h a n d l e   m a n a g e m e n t   a r e a 
 
 	 W a i t   S e c o n d s   0 . 5 
 
 	 S l o t ( 5 )     =       1 	       	 ' Z   l o w e r   t h e   h a n d l e 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t ( 5 )     =     8 0 	   	 ' Z   r e t u r n   h a n d l e r   t o   m i d d l e 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 R e t u r n 
 
 
 
 ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 ' - - - - -   S   U   B   R   O   U   T   I   N   E       A   R   E   A     - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 '   = = = = = = = = = = = = = = =   H O M E   A L L   M O T O R s   M 0 ,   M 1 ,   M 2   a n d   M 3   = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   " H O M E   A l l " 
 
 	 G o s u b   B L U 
 
 	 S l o t ( 1 )   =   S l o t ( 1 )   -   5 	 	 	 '   E v e n t u a l l y   d e t a c h   t h e   p e n   f r o m   p a n e l 
 
 	 G o s u b   " H o m e   M 3 ( A ) " 
 
 	 G o s u b   " H o m e   M 2 ( Z ) " 
 
 	 G o s u b   " H o m e   M 1 ( Y ) " 
 
 	 G o s u b   " H o m e   M 0 ( X ) " 
 
 R e t u r n 
 
 
 
 L a b e l   " H o m e   M 0 ( X ) " 
 
 	 S l o t M o t o r   =   1 
 
 	 S l o t S e n s o r   =   1 9 
 
 	 S p e e d S e a r c h   =   - 0 . 2 	 	 ' - 0 . 1 
 
 	 S p e e d R e t u r n   =   + 0 . 0 0 5 
 
 	 D e c l a r e d Z e r o   =   0 
 
 	 I n i t i a l P o s i t i o n   =   2 
 
 	 G o s u b   " H o m e " 
 
 R e t u r n 
 
 
 
 L a b e l   " H o m e   M 1 ( Y ) " 
 
 	 S l o t M o t o r   =   3 
 
 	 S l o t S e n s o r   =   2 0 
 
 	 S p e e d S e a r c h   =   - 0 . 2 	 	 ' - 0 . 1 
 
 	 S p e e d R e t u r n   =   + 0 . 0 5 
 
 	 D e c l a r e d Z e r o   =   0 
 
 	 I n i t i a l P o s i t i o n   =   2 
 
 	 G o s u b   " H o m e " 
 
 R e t u r n 
 
 
 
 L a b e l   " H o m e   M 2 ( Z ) " 
 
 	 S l o t M o t o r   =   5 
 
 	 S l o t S e n s o r   =   2 1 
 
 	 S p e e d S e a r c h   =   + 0 . 1 
 
 	 S p e e d R e t u r n   =   - 0 . 0 0 5 
 
 	 D e c l a r e d Z e r o   =   1 0 3 
 
 	 I n i t i a l P o s i t i o n   =   1 0 0 
 
 	 G o s u b   " H o m e " 
 
 R e t u r n 
 
 
 
 L a b e l   " H o m e   M 3 ( A ) " 
 
 	 S l o t M o t o r   =   2 5 
 
 	 S l o t S e n s o r   =   3 1 
 
 	 S p e e d S e a r c h   =   - 0 . 0 8 
 
 	 S p e e d R e t u r n   =   + 0 . 0 5 
 
 	 D e c l a r e d Z e r o   =   0 
 
 	 I n i t i a l P o s i t i o n   =   2 
 
 	 G o s u b   " H o m e " 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = =   H O U S E   A L L   M O T O R S   M 0 ,   M 1 ,   M 3   = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   " H O U S E " 
 
 	 G o s u b   B L U 
 
 	 S l o t ( 5 )     =     9 8 	   	 ' Z   R a i s e 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t ( 1 )     =     2           	 ' X   g o   t o   H O U S E 
 
 	 S l o t ( 2 5 )   =     2           	 ' A   g o   t o   H O U S E 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = =   H O M E   M O T O R   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   " H o m e " 
 
 	 G o s u b   B l u 
 
 	 I f   S l o t ( S l o t S e n s o r )   >   5 0 0             '   d e t a c h   i f   s e n s o r   a c t i v e 
 
 	 	 S l o t ( S l o t M o t o r )   =   S l o t ( S l o t M o t o r )   +   S p e e d R e t u r n 
 
 	 E n d I f 
 
 ' 
 
 L a b e l   S e a r c h H o m e 
 
 	 S l o t ( S l o t M o t o r )   =   S l o t ( S l o t M o t o r )   +   S p e e d S e a r c h 
 
 	 W a i t   S e c o n d s   0 . 0 0 1 
 
 	 I f   S l o t ( S l o t S e n s o r )   >   5 0 0   	 '   l i m i t   s w i t c h 
 
 	 	 G o s u b   W a i t M o t o r 	 	 	 '   W A I T   U N T I L   M O T O R   S T O P 
 
 	 	 W a i t   S e c o n d s   0 . 1 	 	 '   t a b i l i z e   m e c h a n i c a l l y 
 
 	 	 G o t o   D e t a c h S e n s o r 
 
 	 E n d I f 
 
 G o t o   S e a r c h H o m e 
 
 ' 
 
 L a b e l   D e t a c h S e n s o r 
 
 	 S l o t ( S l o t M o t o r )   =   S l o t ( S l o t M o t o r )   +   S p e e d R e t u r n   '   d i r e c t i o n / s p e e d   r e t u r n 
 
 	 W a i t   S e c o n d s   0 . 0 0 1 
 
 	 I f   S l o t   ( S l o t S e n s o r )   <   5 0 0 
 
 	 	 G o s u b   W a i t M o t o r 
 
 	 	 G o t o   A s s i g n Z e r o 
 
 	 E n d I f 
 
 G o t o   D e t a c h S e n s o r 
 
 ' 
 
 L a b e l   A s s i g n Z e r o 
 
 	 S l o t ( S l o t M o t o r )   =   R e s e t 	 	 	 '   R e s e t   t h e   s l o t   v a l u e 
 
 	 W a i t   S e c o n d s   0 . 1 	 	     	 	 '   D O   N O T   T O U C H   T H E   V A L U E ,   n e e d e d   t o   t h e   M a s t e r ! ! ! ! 
 
 	 S l o t ( S l o t M o t o r )   =   D e c l a r e d Z e r o 
 
 	 G o s u b   W a i t M o t o r 
 
 	 S l o t ( S l o t M o t o r )   =   I n i t i a l P o s i t i o n 
 
 	 G o s u b   W a i t M o t o r 
 
 	 G o s u b   B L U 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = =   W   A   I   T   u n t i l   t h e   m o t o r ( S l o t M o t o r )   i s   s t o p p e d   = = = = = = = = 
 
 L a b e l   W a i t M o t o r 
 
 '   - - - - - - - - - - - - - - - - - -   t h i s   W a i t   e n s u r e s   t h a t   t h e   m o t o r s   i a   r u n n i n g 
 
 	 W a i t   S e c o n d s   0 . 1 
 
 	 L a b e l   W a i t 1 
 
 	 	 I f   A b s ( S l o t ( S l o t M o t o r   +   1 ) )   <   0 . 0 1 
 
 	 	 	 R e t u r n 	 	 	 '   n o w   t h e   m o t o r   i s   n o t   r u n n i n g 
 
 	 	 E n d I f 
 
 	 	 W a i t   S e c o n d s   0 . 0 0 5 
 
 	 G o t o   W a i t 1 
 
 '   - - - - - - - - - - - - - - - - - -   t h i s   l i n e   i s   r e q u i r e d   t o   i n d e n t   c o r r e c t l y 
 
 G o t o   W a i t M o t o r 
 
 
 
 '   = = = = = = = = = = = = = = =   W   A   I   T     a l l   M O T O R S   a r e   S T O P P E D   = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   W a i t A l l M o t o r s 
 
 '   - - - - - - - - - - - - - - - - - -   t h i s   W a i t   e n s u r e s   t h a t   t h e   m o t o r s   a r e   r e a l l y   s t a r t e d 
 
 	 W a i t   S e c o n d s   0 . 1 
 
 	 L a b e l   W a i t A l l M o t o r s 2 
 
 	 	 I f   A b s ( S l o t ( 2 ) )   <   0 . 0 1   A n d   A b s ( S l o t ( 4 ) )   <   0 . 0 1   A n d   A b s ( S l o t ( 6 ) )   <   0 . 0 1   A n d   A b s ( S l o t ( 2 6 ) )   <   0 . 0 1 
 
 	 	 	 R e t u r n 
 
 	 	 E n d I f 
 
 	 	 W a i t   S e c o n d s   0 . 0 1 
 
 	 G o t o   W a i t A l l M o t o r s 2 
 
 '   - - - - - - - - - - - - - - - - - -   t h i s   l i n e   i s   r e q u i r e d   t o   i n d e n t   c o r r e c t l y 
 
 G o t o   W a i t A l l M o t o r s 
 
 
 
 '   = = = = = = = = = = = = = = =   E N A B L E   /   D I S A B L E   M O T O R S   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 ' L a b e l   E n a b l e M o t o r 
 
 ' 	 S l o t   1 1   =   0 
 
 ' 	 W a i t   S e c o n d s   0 . 2 
 
 ' R e t u r n 
 
 ' 
 
 ' L a b e l   D i s a b l e M o t o r 
 
 ' 	 S l o t   1 1   =   1 0 0 0 
 
 ' 	 W a i t   S e c o n d s   0 . 2 
 
 ' R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = =   T R A F F I C   L I G H T   C O L O R   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   R E D 
 
 	 S l o t   1 6   =   8 0 0 	 	 ' R E D 
 
 	 S l o t   1 7   =         0 	 	 ' G R E 
 
 	 S l o t   1 8   =         0 	 	 ' B L U 
 
 R e t u r n 
 
 
 
 L a b e l   G R E 
 
 	 S l o t   1 6   =         0 	 	 ' R E D 
 
 	 S l o t   1 7   =     8 0 0 	 	 ' G R E 
 
 	 S l o t   1 8   =         0 	 	 ' B L U 
 
 R e t u r n 
 
 
 
 L a b e l   B L U 
 
 	 S l o t   1 6   =         0 	 	 ' R E D 
 
 	 S l o t   1 7   =         0 	 	 ' Y E L 
 
 	 S l o t   1 8   =     8 0 0 	 	 ' B L U 
 
 R e t u r n 
 
 
 
 L a b e l   W H I 
 
 	 S l o t   1 6   =     7 0 0 	 	 ' R E D 
 
 	 S l o t   1 7   =     7 0 0 	 	 ' Y E L 
 
 	 S l o t   1 8   =     7 0 0 	 	 ' B L U 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = =   M O V E   U S I N G   K E Y B O A R D   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   M o v e R i g h t M 0 
 
 	 S l o t ( 1 )   =   S l o t ( 1 )   +   1 
 
 	 R e t u r n 
 
 L a b e l   M o v e L e f t M 0 
 
 	 S l o t ( 1 )   =   S l o t ( 1 )   -   1 
 
 	 R e t u r n 
 
 L a b e l   M o v e R i g h t M 1 
 
 	 S l o t ( 2 5 )   =   S l o t ( 2 5 )   +   1 
 
 	 R e t u r n 
 
 L a b e l   M o v e L e f t M 1 
 
 	 S l o t ( 2 5 )   =   S l o t ( 2 5 )   -   1 
 
 	 R e t u r n 
 
 L a b e l   M o v e U p M 2 
 
 	 S l o t ( 5 )   =   S l o t ( 5 )   +   1 
 
 	 R e t u r n 
 
 L a b e l   M o v e D o w n M 2 
 
 	 S l o t ( 5 )   =   S l o t ( 5 )   -   1 
 
 R e t u r n 
 
 
 
 ' = = = = = =   D U M M Y   A R E A   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 ' = = = = = =   T O   D O   A R E A   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 ' = = = = = =   S E T   U P   A R E A   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 
 
 
 
 ' W A T C H   S l o t M o t o r 
 
 ' W A T C H   A b s ( S l o t ( S l o t M o t o r ) ) 
 
 ' E X E C   S i n 2   =   S i n ( 3 3 ) 
 
 